{% extends 'login/base.html' %}
{% block index %}

    <div class="card mb-3">

{#        <div class="col-4 offset-4">#}
{#            <h3 class="card-title text-center" style="margin-top: 30px">{{ news.title }}</h3>#}
{##}
{#            <img src="/media/{{ news.photo }}" class="card-img-top" alt="{{ news.photo }}">#}
{#        </div>#}
        <div class="card-body">
            <div class="card-text">
                <div class="article-content bg-color markdown-body">
                    <div class="post-content" style="padding: 10px 20px 20px 10px">
                        <div class="code text_dark">
                            {{ blog.content|safe }}
                        </div>
                    </div>
                </div>
            </div>
            <p class="card-text"><small class="text-muted">发布时间：{{ news.time }}</small></p>
        </div>
        <form action="{% url 'user_index' news.id %}" method="post">
            {% csrf_token %}

            <div class="input-group mb-3" style="padding: 10px 40px 10px 40px">
                <input name="text" type="text" class="form-control" placeholder="&emsp;留言内容"
                       aria-label="Recipient's username"
                       aria-describedby="basic-addon2">
                <button type="submit" class="input-group-text" id="basic-addon2">发送</button>
            </div>
        </form>
        <hr>

        <h3 style="margin-left: 30px">留言内容：</h3>
        {% for i in message %}
            <div class="col-12">
                <div class="row" style="padding: 15px">

                    <div class="col-1 text-center" style="margin-top: 20px">
                        <img src="/media/{{ i.user.photo }}" style="border-radius: 50%" height="60px" width="60px"
                             alt="{{ i.user.photo }}">
                        <br>
                        <p>{{ i.user.name }}</p>

                    </div>
                    <div class="col-11 alert alert-secondary" role="alert" style="vertical-align: middle">
                        <p>内容：{{ i.message }}</p>
                        <br>
                        时间：{{ i.time }}
                    </div>

                </div>
            </div>
        {% empty %}
            <div class="text-center">
                <h4>暂无评论....</h4>
                <br>
            </div>

        {% endfor %}
    </div>


{% endblock %}
{% block href %}
    <ul class="nav flex-column">
        {% for i in href %}
            <li class="nav-item mb-2"><a href="{{ i.href }}" class="nav-link p-0 text-muted">{{ i.title }}</a></li>
        {% endfor %}


    </ul>
{% endblock %}
{% block myhref %}
    <ul class="nav flex-column">
        {% for i in myhref %}
            <li class="nav-item mb-2">
                <img src="/media/{{ i.photo }}" width="40px" height="40px" alt="">
                <a href="#" class="nav-link p-0 text-muted">{{ i.title }}</a>
            </li>
        {% endfor %}


    </ul>
{% endblock %}
{% block Admiration %}
    <p>
        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-balloon-heart"
             viewBox="0 0 16 16">
            <path fill-rule="evenodd"
                  d="m8 2.42-.717-.737c-1.13-1.161-3.243-.777-4.01.72-.35.685-.451 1.707.236 3.062C4.16 6.753 5.52 8.32 8 10.042c2.479-1.723 3.839-3.29 4.491-4.577.687-1.355.587-2.377.236-3.061-.767-1.498-2.88-1.882-4.01-.721L8 2.42Zm-.49 8.5c-10.78-7.44-3-13.155.359-10.063.045.041.089.084.132.129.043-.045.087-.088.132-.129 3.36-3.092 11.137 2.624.357 10.063l.235.468a.25.25 0 1 1-.448.224l-.008-.017c.008.11.02.202.037.29.054.27.161.488.419 1.003.288.578.235 1.15.076 1.629-.157.469-.422.867-.588 1.115l-.004.007a.25.25 0 1 1-.416-.278c.168-.252.4-.6.533-1.003.133-.396.163-.824-.049-1.246l-.013-.028c-.24-.48-.38-.758-.448-1.102a3.177 3.177 0 0 1-.052-.45l-.04.08a.25.25 0 1 1-.447-.224l.235-.468ZM6.013 2.06c-.649-.18-1.483.083-1.85.798-.131.258-.245.689-.08 1.335.063.244.414.198.487-.043.21-.697.627-1.447 1.359-1.692.217-.073.304-.337.084-.398Z"/>
        </svg>
        咖啡续命
    </p>
    {% for i in admiration %}

        <div class="card">

            <img src="/media/{{ i.photo }}" class="card-img-top" alt="...">
            <div class="card-body">
                <h5 class="card-title text-center">{{ i.title }}</h5>
            </div>
        </div>
    {% endfor %}
{% endblock %}